/*
 * www.7yangche.com Inc.
 * Copyright (c) 2012 All Rights Reserved.
 */
package cbh.tool.mybatis.crud;

import cbh.tool.mybatis.page.Page;

import java.util.List;
import java.util.Map;


/**
 * @author cyzhang
 * 
 * @param <E> 实体对象，实际上为查询返回的结果。
 *
 */
@CrudComponent
public abstract class CrudEntitySupport<E> extends CrudSupport  {

    public E insert(E tenant) {
        return super.<E> insert_(tenant);
    }

    public int update(E tenant) {
        return super.<E> update_(tenant);
    }

    public int delete(E tenant) {
        return super.<E> delete_(tenant);
    }

    public List<E> select(Object parameter) {
        return super.<E> select_(parameter);
    }
    
    public List<E> all() {
        return this.select(null);
    }
    
    public Page<E> page(int pageNum, int pageSize) {
        return this.page(pageNum, pageSize, null);
    }

    public Page<E> page(int pageNum, int pageSize, Map<String, ? extends Object> parameter) {
        return super.<E> page_(pageNum, pageSize, parameter);
    }

    public Long count(Object parameter) {
        return super.count_(parameter);
    }

    public E one(Object parameter) {
        return super.<E> one_(parameter);
    }

}
